<!DOCTYPE html>
<html lang="en">
<head>
<#include "/admin/common/app.ftl">
<script type="text/javascript" src="http://cdn.bootcss.com/jquery.form/3.51/jquery.form.min.js"></script>
<script type="text/javascript" src="${basePath}/res/cdn/jQuery-tagEditor-master/jquery.tag-editor.min.js"></script>
<script type="text/javascript" src="${basePath}/res/cdn/jQuery-tagEditor-master/jquery.caret.min.js"></script>
<link rel="stylesheet" href="${basePath}/res/cdn/jQuery-tagEditor-master/jquery.tag-editor.css">
<link href="//cdn.bootcss.com/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.min.css" rel="stylesheet">
<script src="//cdn.bootcss.com/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap-datepicker/1.4.1/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="text/javascript">
	$(function() {
		$("#confForm").submit(function() {
			$("#confForm").ajaxSubmit({
				dataType : "json",
				success : function(json) {
					if (json.flag) {
						alert("操作成功");
					} else {
						alert(json.msg);
					}
				}
			});
			return false;
		});
	});
</script>
</head>
<body class="container-fluid">
	<div class="page-title">
		<div class="title-env">
			<h1 class="title">栏目编辑</h1>
			<p class="description">Plain text boxes, select dropdowns and other basic form elements</p>
		</div>
	</div>
	<form id="confForm" role="form" method="post" action="${basePath}/cms/category/save">
		<input autocomplete="off" name="id" value="${data.id}" type="hidden" />
		<div class="row form-horizontal">
			<div class="col-xs-12">
				<div class="form-group">
					<label class="col-sm-2 control-label">名称</label>
					<div class="col-sm-10">
						<input class="form-control" name="name" value="${data.name}">
					</div>
				</div>
				<div class="form-group-separator"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label">别名</label>
					<div class="col-sm-10">
						<input class="form-control" name="code" value="${data.code}" />
					</div>
				</div>
				<div class="form-group-separator"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label"> 排序（ <span id="sort"></span> ）
					</label>
					<div class="col-sm-10">
						<input class="form-control" type="range" name="sort" value="${data.sort}" min="1" max="10" onload="$(this).change();"
							onchange="$('#sort').text($(this).val())" />
					</div>
				</div>
				<div class="form-group-separator"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label" >父栏目</label>
					<div class="col-sm-10">
						<select name="pid" class="form-control" autocomplete="off">
							<option value="">无</option> 
							<#list cglist as item>
							<option value="${item.id}" <#if data.pid==item.id> selected="selected"</#if>>${item.name}</option>
							</#list>
						</select>
					</div>
				</div>
				<div class="form-group-separator"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="C_TEMPLATE">模版</label>
					<div class="col-sm-10">
						<input autocomplete="off" class="form-control" id="cgtp" name="cgtp" value="${data.cgtp}">
					</div>
				</div>
				<div class="form-group-separator"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="A_TEMPLATE">文章模版</label>
					<div class="col-sm-10">
						<input autocomplete="off" class="form-control" id="A_TEMPLATE" name="atp" value="${data.atp}">
					</div>
				</div>
				<div class="form-group-separator"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label" for="SYS_COPYRIGHT">摘要</label>
					<div class="col-sm-10">
						<textarea name="memo" cols="5" class="form-control autogrow" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 70px;">${data.memo}</textarea>
					</div>
				</div>
				<div class="form-group-separator"></div>
				<button class="btn btn-success btn-icon pull-right" type="submit">
					<span> 保 存 </span> <i class="fa-check"></i>
				</button>
			</div>
		</div>
	</form>
</body>
</html>